﻿<!--
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
-->

<common:LayoutAwarePage
    x:Class="Tiles.Globalization"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Tiles"
    xmlns:common="using:SDKTemplate.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid x:Name="LayoutRoot" Background="White" HorizontalAlignment="Left" VerticalAlignment="Top">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid x:Name="Input" Grid.Row="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <StackPanel>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" FontWeight="SemiBold">
                    This scenario demonstrates how to display a different image resource based on the user's current localization, scale and accessibility settings.
                </TextBlock>

                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" Margin="0,10,0,0">
                    Windows fully supports localization, scale, and accessibility for web images and packaged text and images. Web servers can take advantage of these features by returning specific images depending on the variables encapsulated in a query string. Packaged images and text use the Resource Management System and require no further changes than what your application already does for localization, scale, and accessibility.
                    <LineBreak/><LineBreak/>
                    For web images, add the optional boolean attribute addImageQuery to the image, binding, or visual node to have Windows automatically append query strings. The query strings are appended to the image URL provided in the notification payload when the image is requested from the image service. The image service used should respond with the appropriate image based on the parameters supplied in the query string.
                    <LineBreak/><LineBreak/>
                    To test what query string will be appended to image URLs, you can easily change the current settings of your system.
                    <LineBreak/>
                </TextBlock>

                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" Margin="0,10,0,0" FontWeight="SemiBold">
                    Scale
                </TextBlock>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap">
                    Make it easier to read in the Ease of Access page in PC Settings.
                </TextBlock>

                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" Margin="0,10,0,0" FontWeight="SemiBold">
                    High Contrast
                </TextBlock>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap">
                    High Contrast Theme in the Ease of Access page in PC Settings.
                </TextBlock>

                <TextBlock Style="{StaticResource BasicTextStyle}" VerticalAlignment="Center" TextWrapping="Wrap" FontWeight="SemiBold" Margin="0,20,0,0">
                    View the current settings of your PC and preview the query string
                </TextBlock>
                <StackPanel Orientation="Horizontal">
                    <Button x:Name="ViewCurrentResources" Content="View current resources" Click="ViewCurrentResources_Click"/>
                </StackPanel>

                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" FontWeight="SemiBold" Margin="0,20,0,0">
                    Send a tile notification with a web image and query strings
                </TextBlock>
                <StackPanel Orientation="Horizontal">
                    <TextBox x:Name="ImageUrl" Text="http://" Width="200"/>
                    <Button x:Name="SendTileNotificationWithQueryStrings" Content="Send tile notification with query strings" Click="SendTileNotificationWithQueryStrings_Click"/>
                </StackPanel>

                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" FontWeight="SemiBold" Margin="0,20,0,0">
                    Send tile notifications with packaged resources
                </TextBlock>
                <StackPanel Orientation="Horizontal">
                    <Button x:Name="SendTileNotificationImage" Content="Send tile notification with images" Click="SendTileNotificationScaledImage_Click"/>
                    <Button x:Name="SendTileNotificationText" Content="Send tile notification with text" Click="SendTextResourceTileNotification_Click"/>
                </StackPanel>
            </StackPanel>
        </Grid>

        <Grid x:Name="Output" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Row="1">
            <TextBlock x:Name="OutputTextBlock" Text="" TextWrapping="Wrap"  Style="{StaticResource BasicTextStyle}" IsTextSelectionEnabled="True"/>
        </Grid>

        <!-- Add Storyboards to the visual states below as necessary for supporting the various layouts -->
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup>
                <VisualState x:Name="DefaultLayout"/>
                <VisualState x:Name="Below768Layout"/>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>

</common:LayoutAwarePage>
